package com.fesine.learn;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @描述:启动Dubbo服务用的MainClass
 */
public class DubboProvider {

	private static final Log log = LogFactory.getLog(DubboProvider.class);

	public static void main(String[] args) {
		try {
			ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring.xml");
			context.start();
		} catch (Exception e) {
			log.error("--->dubbo服务启动失败:", e);
		}

		synchronized (DubboProvider.class) {
			while (true) {
				try {
					log.info("---->服务已经启动！");
					DubboProvider.class.wait();
				} catch (InterruptedException e) {
					log.error("---->同步报错", e);
				}

			}

		}

	}

}